<?php
class Zen_Filter_List {

	private $name = 'label';
	
	private function mapArray($data) {
		$name = $this->getName();
		$result = array();
		foreach ( $data as $item ) {
			$result[$item['id']] = $item[$name];
		}
		return $result; 
	}

	public function getName() {
		return $this->name;
	}

	public function setName($name) {
		$this->name = $name;
		return $this;
	}
	
	public function filter($data) {
		if(sizeof($data)>0){
			return $this->mapArray ($data);
		}
		else{
			return array();
		}
	}
}